#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n,i;
	int t = 0;
	float s = 0, r = 0, Q = 0;

	printf("Please input n= ");
	scanf("%d", &n);
	for (i = 1; i <= n; i++)
	{
		
		if (i % 2 == 0)
		{
			s = s + (-1) * (1) /(float)i;
		}
		else
		{
			r = r + 1 / (float)i;
		}

	}
	Q = s + r;
	printf("1-1/2+1/3+....+1/n=%f", Q);
	return 0;
}